/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package EntityState;

import java.io.Serializable;

/**
 *
 * @author James
 */
public class VoucherState implements Serializable {
    private String  id;
    private String  name;
    private int     discount;      // Positive only for amount (e.g. 20 mean $20 voucher)
    private int     voucherType;   // Can only be redeemed at specific: 0. everywhere, 1. sector, 2. partner, 3. outlet
    private int     redeemPlaceID; // The ID of the sector/partner/outlet
    private long    requestedDate;
    private long    expiryDate;    // 0 means indefinite
    private boolean used;
    private CustomerState voucherRequester; //null means TCube is the requester
    private ItemState     theItem;       
    private TermsAndConditionsState theTerm;

    public VoucherState(String id, String name) {
        this.id   = id;
        this.name = name;
    }

    public VoucherState(String id, String name, int discount, int voucherType, int redeemPlaceID, long requestedDate, long expiryDate, boolean used, CustomerState voucherRequester, ItemState theItem, TermsAndConditionsState theTerm) {
        this.id            = id;
        this.name          = name;
        this.discount      = discount;
        this.voucherType   = voucherType;
        this.redeemPlaceID = redeemPlaceID;
        this.requestedDate = requestedDate;
        this.expiryDate    = expiryDate;
        this.used          = used;
        this.voucherRequester = voucherRequester;
        this.theItem       = theItem;
        this.theTerm       = theTerm;
    }
    
    //Getters and Setters
    public int getDiscount() {
        return discount;
    }

    public void setDiscount(int discount) {
        this.discount = discount;
    }

    public long getExpiryDate() {
        return expiryDate;
    }

    public void setExpiryDate(long expiryDate) {
        this.expiryDate = expiryDate;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getRedeemPlaceID() {
        return redeemPlaceID;
    }

    public void setRedeemPlaceID(int redeemPlaceID) {
        this.redeemPlaceID = redeemPlaceID;
    }

    public long getRequestedDate() {
        return requestedDate;
    }

    public void setRequestedDate(long requestedDate) {
        this.requestedDate = requestedDate;
    }

    public ItemState getTheItem() {
        return theItem;
    }

    public void setTheItem(ItemState theItem) {
        this.theItem = theItem;
    }

    public TermsAndConditionsState getTheTerm() {
        return theTerm;
    }

    public void setTheTerm(TermsAndConditionsState theTerm) {
        this.theTerm = theTerm;
    }

    public boolean isUsed() {
        return used;
    }

    public void setUsed(boolean used) {
        this.used = used;
    }

    public CustomerState getVoucherRequester() {
        return voucherRequester;
    }

    public void setVoucherRequester(CustomerState voucherRequester) {
        this.voucherRequester = voucherRequester;
    }

    public int getVoucherType() {
        return voucherType;
    }

    public void setVoucherType(int voucherType) {
        this.voucherType = voucherType;
    }
}
